/*******************************************************************************
*  file    : file_format_simple.hpp
*  created : 19.06.2014
*  author  : Slyshyk Oleksiy (alexSlyshyk@gmail.com)
*******************************************************************************/

#ifndef FILE_FORMAT_SIMPLE_HPP
#define FILE_FORMAT_SIMPLE_HPP

#include <QObject>
#include <QtPlugin>
#include <interfaces.hpp>

class FileFormatSimple: public QObject, public ReadFileFormatInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "tmx.com.ua.dsp.lab.ReadFileFormatInterface" FILE "simple_plugin.json")
    Q_INTERFACES(ReadFileFormatInterface)
public:
    QString     name() const ;
    QStringList formats() const;
    QString     fileFilter() const;
    void        setName(const QString&);
    double      sampleRate() const ;
    QVector<std::complex<double> > getData();
    bool        read();
    bool        read(const QString&);
    void        flush();
private:
    QString fileName_;
    QVector<std::complex<double> > data_;
    double  dataTime_;
};

#endif // FILE_FORMAT_SIMPLE_HPP
